<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="ComposizioneCreateDlg" widgetVar="ComposizioneCreateDialog" modal="true" resizable="false" appendToBody="true" header="#{myBundle.CreateComposizioneTitle}" closeOnEscape="true">

            <h:form id="ComposizioneCreateForm">

                <h:panelGroup id="display">
                    <p:panelGrid columns="2">


                        <p:outputLabel value="#{myBundle.CreateComposizioneLabel_idElemento}" for="idElemento" />
                        <p:selectOneMenu id="idElemento" value="#{composizioneController.selected.idElemento}" required="true" requiredMessage="#{myBundle.EditComposizioneRequiredMessage_idElemento}" converter="elementoConverter">
                            <f:selectItem itemLabel="#{myBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{elementoController.items}"
                                           var="idElementoItem"
                                           itemValue="#{idElementoItem}"
                                           itemLabel="#{idElementoItem.idELEMENTO.toString()}"
                                           />

                        </p:selectOneMenu>

                        <p:outputLabel value="#{myBundle.CreateComposizioneLabel_idViaggio}" for="idViaggio" />
                        <p:selectOneMenu id="idViaggio" value="#{composizioneController.selected.idViaggio}" required="true" requiredMessage="#{myBundle.EditComposizioneRequiredMessage_idViaggio}" converter="viaggioConverter">
                            <f:selectItem itemLabel="#{myBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{viaggioController.items}"
                                           var="idViaggioItem"
                                           itemValue="#{idViaggioItem}"
                                           itemLabel="#{idViaggioItem.idVIAGGIO.toString()}"
                                           />

                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{composizioneController.saveNew}" value="#{myBundle.Save}" 
                                     update="display,:FilteredCameraListForm:datalist1,:FilVoloListForm:datalist1,:FilEscursioneListForm:datalist1,:growl" 
                                     oncomplete="handleSubmit(xhr,status,args,ComposizioneCreateDialog);"/>
                    <p:commandButton value="#{myBundle.Cancel}" onclick="ComposizioneCreateDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
